import axios from '@/utils/request';

/**
 * 新增费用
 */
export async function AddCostmanager(params) {
    const res = await axios.post('/Costmanager/AddCostmanager',params);
    if (res.data.code === 200) {
        return res.data.msg;
    }
    return Promise.reject(new Error(res.data.msg));
}


/**
 * 更新费用
 */
export async function UpdateCostmanager(params) {
    const res = await axios.post('/Costmanager/UpdateCostmanager',params);
    if (res.data.code === 200) {
        return res.data.msg;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 删除费用
 */
export async function DeleteCostmanager(id) {
    const res = await axios.post('/Costmanager/DeleteCostmanager?id='+id);
    if (res.data.code === 200) {
        return res.data.msg;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 根据id获取费用信息
 */
export async function GetCostById(id) {
    const res = await axios.get('/Costmanager/GetModelById/'+id);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 获取费用信息查询分页列表
 */
 export async function QueryCostmanagerPageList(params) {
    const res = await axios.post('/Costmanager/QueryCostmanagerPageList',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}

 /**
  * 修改费用信息状态信息
  */
 export async function UpdateStatus(params) {
    const res = await axios.post('/Costmanager/UpdateStatus',params);
    if (res.data.code === 200) {
        return res.data.msg;
    }
    return Promise.reject(new Error(res.data.msg));
  }




